<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<%
	request.setCharacterEncoding("utf-8");
	String cp = request.getContextPath();
	
	int i=0;
%>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>이미지 게시판</title>
 
<link rel="stylesheet" href="<%=cp%>/data/css/style.css" type="text/css"/>
 
</head>
 
<body style="font-size :9pt;">
 
<br/>&nbsp;<br/>
 
<table width="600" border="2" cellspacing="0" cellpadding="0" bordercolor="#D6D4A6" align="center">
<tr height="40"> 
<td style="padding-left:25px;">
<b>이미지 게시판</b>
</td>
</tr>
</table>
<br/>
 
<table width="600" border="0" cellpadding="0" cellspacing="0" align="center">
   <tr height="30">
      <td align="left" width="50%">
        전체 데이터 : ${totalDataCount} , 전체 페이지 ${totalPage}
				 / 현재 페이지 ${pageNum}
      </td>
      <td align="right">
        <input type="button" value=" 게시물 등록 " 
        onclick="javascript:location.href='<%=cp%>/imageTest/save.action?pageNum=${pageNum }';" class="btn1"/>
      </td>
    </tr>
</table>
 
<table width="600" border="0" cellpadding="0" cellspacing="0" align="center">
	
  <tr><td height="3" bgcolor="#DBDBDB" align="center"></td></tr>
</table>
 
 
<table width="600" border="0" cellspacing="1" cellpadding="3" bgColor="#FFFFFF" align="center">
 <tr bgcolor="#FFFFFF"> 
  <c:forEach var="dto" items="${lists}">   
  <td>
  <table>
  <% i=i+1; %>
   <tr bgcolor="#FFFFFF">
    <td align="center" height="30" colspan="3">
    <a href ="${urlImageFile}/${dto.saveFileName}" target="_blank">
    <img src="${urlImageFile}/${dto.saveFileName}" width="180" height="180" border="0" />
	 </a>
	</td>
   </tr>
   <tr bgcolor="#FFFFFF">
   <td align="center" height="15" colspan="3">
   ${dto.subject}
   </td>
   </tr>
   <tr bgcolor="#FFFFFF">
    <td align="center" height="15" colspan="3">
    <a href="<%=cp %>/imageTest/download.action?fileNum=${dto.num}&">${dto.originalFileName} </a>
    </td>
   </tr>
   <tr bgcolor="#FFFFFF">
   <td align="center" height="15" colspan="3">
   <a href="<%=cp %>/imageTest/delete.action?fileNum=${dto.num}&pageNum=${pageNum}">삭제</a>
   </td>
   </tr>	
   
   
  </table>
  </td>
  <% 
   if(i%3 == 0){
   out.print("</tr>");
   out.print("<tr>");
   }
  %>
  
  </c:forEach>
 </tr>
 
 </table>
 
<table width="600" border="0" cellpadding="0" cellspacing="0" align="center">
  <tr><td height="3" bgcolor="#DBDBDB" align="center"></td></tr>
</table>
<center>
		
<c:if test="${totalDataCount == 0}">		
<table>
		
		<tr bgcolor="#ffffff" height="30">
			<td align="center" colspan="5">
				등록된 자료가 없습니다
			</td>
		</tr>

</table>
	</c:if>

<c:if test="${totalDataCount != 0 }">
	<table width="600" border="0" cellpadding="3" cellspacing="0" align="center">
		<tr align="center">
			<td align="center" height="30">${pageIndexList }</td>
		</tr>
	</table>
</c:if>
</center>
</body>
</html>
 